﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using SubSonic;
using Coolite.Ext.Web;
using CXDB;
using Comparison = SubSonic.Comparison;
public partial class Search_Provider_Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        
    }
    protected void Search(object s, AjaxEventArgs e)
    {
        Query q = new Query(CxProvider.Schema);
        q.SetSelectList(
            "id,providername,devicename,dept_master_status,tech_master_status,office_master_status,boss_status,intime,guid");

        if (tfprovidername.Text != "")
        {
            q.AddWhere("providername", SubSonic.Comparison.Like, "%" + tfprovidername.Text.Trim() + "%");
        }
        if (tfdevicename.Text !="")
        {
            q.AddWhere("devicename", SubSonic.Comparison.Like, "%" + tfdevicename.Text.Trim() + "%");
        }
        q.AddWhere("dept_master_status", 1);
        q.AddWhere("tech_master_status", 1);
        q.AddWhere("office_master_status", 1);
        q.AddWhere("boss_status", 1);
        StoreDetail.DataSource = q.ExecuteDataSet();
        StoreDetail.DataBind();

    }
    protected void ApplySub(object s, AjaxEventArgs e)
    {
        string id = e.ExtraParams["id"].ToString();
        tfhiddenid.Value = id;
        Window1.Show();
    }
    protected void Sub(object s, AjaxEventArgs e)
    {
        ApplyAction.Add(new Guid(tfhiddenid.Value.ToString()), tfreason.Text, "cx_provider");
        Window1.Hide();
    }
    protected void Cancel(object s, AjaxEventArgs e)
    {
        Window1.Hide();
    }
}
